
export default {

	get() {
	    var platform = '';
	    
	    // #ifdef MP-WEIXIN
	    platform = 'wxMiniProgram';
	    // #endif
	    
	    // #ifdef H5
	    platform = 'h5';
	    // #endif
	    
	    // 获取系统信息，检测安卓或iOS
	    const systemInfo = uni.getSystemInfoSync();
	    if (systemInfo.platform === 'android') {
	        platform = 'android';
	    } else if (systemInfo.platform === 'ios') {
	        platform = 'ios';
	    }
	
	    if (platform !== '') {
	        uni.setStorageSync('platform', platform);
	    } else {
	        uni.showToast({
	            title: '暂不支持该平台',
	            icon: 'none'
	        });
	    }
	
	    return platform;
	},


	
	// wechat jssdk 签名网址
	entry() {
		var entryUrl = location.href;
		if (this.device() === 'ios') {
			if (typeof(location.entryUrl) !== 'undefined') {
				entryUrl = location.entryUrl;
			} else {
				location.entryUrl = entryUrl;
			}
		}
		return entryUrl;
	},
	
	// 运行机型
	device() {
		return uni.getSystemInfoSync().platform;
	},

}
